//
//  WatermarkEditView.m
//  WatermarkCamera
//
//  Created by zhibao on 2023/9/12.
//

#import "WatermarkEditView.h"
#import "LocationModel.h"
#import "WatermarkEditCell.h"
#import "SelectTimeTypeView.h"
#import "SelectAddressView.h"
#import "BeizhuView.h"
@interface WatermarkEditView()<UITableViewDelegate,UITableViewDataSource>{
    NSString *timeType;
}
@property (nonatomic,strong) MYTableView *showTableView;
@property(nonatomic,strong)NSMutableArray *dataArray;
@property(nonatomic,strong) NSString *type;
@end
@implementation WatermarkEditView
- (instancetype)initWithType:(NSString *)type{
    self = [super initWithFrame:CGRectMake(0, MY_Screen_H, MY_Screen_W, MY_Screen_H)];
    if(self){
        DLog(@"shuiyin==%@",[MYGlobal share].shuiyinDic);
        self.type = type;
        _dataArray = [NSMutableArray new];
        self.backgroundColor = MyColorAlpha(@"000000", 0.0);
        [[UIApplication sharedApplication].delegate.window.rootViewController.view addSubview:self];
        [self initView];
    }
    return self;
}

-(void)initView{
    
    UIView *topView = [[UIView alloc] initWithFrame:CGRectMake(0, MY_Screen_H - 456, MY_Screen_W, 64 + 20)];
    topView.layer.cornerRadius = 20;
    topView.backgroundColor = UIColor.whiteColor;
    [self addSubview:topView];
    
    if(topView){
        UILabel *topTitleLabel = [UILabel new];
        topTitleLabel.text = LocalizedString(@"编辑水印");
        topTitleLabel.font = MY_SCALE_SemiboldFONT(16);
        topTitleLabel.textColor = MYBlock;
        [topView addSubview:topTitleLabel];
        [topTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(topView);
            make.top.mas_equalTo(16);
        }];
        
        UIButton *cancelBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [cancelBtn setImage:[UIImage imageNamed:@"com_close_qian"] forState:UIControlStateNormal];
        [topView addSubview:cancelBtn];
        [cancelBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
        cancelBtn.tag = 1000;
        [cancelBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(15);
            make.right.mas_equalTo(-15);
        }];
    }
    
    self.showTableView = [[MYTableView alloc]initWithFrame:CGRectMake(0, topView.bottom - 20, MY_Screen_W, 277) style:UITableViewStylePlain];
    self.showTableView.delegate = self;
    self.showTableView.dataSource = self;
    
    self.showTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    [self addSubview:self.showTableView];
    self.showTableView.rowHeight = 55;
    self.showTableView.backgroundColor = UIColor.whiteColor;
    self.showTableView.nodataView.backgroundColor = UIColor.whiteColor;
    [self.showTableView removeMJRefresh];
    
    UIView *bottomView = [[UIView alloc]initWithFrame:CGRectMake(0, self.showTableView.bottom, MY_Screen_W, 115)];
    bottomView.backgroundColor = UIColor.whiteColor;
    [self addSubview:bottomView];
    
    if(bottomView){
        UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
        btn.frame = CGRectMake(15, 20, MY_Screen_W - 30, 46);
        btn.layer.cornerRadius = 23;
        [btn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
        btn.backgroundColor = MyColor(@"#12BFFF");
        [bottomView addSubview:btn];
        btn.tag = 1001;
        [btn setTitle:LocalizedString(@"完成") forState:UIControlStateNormal];
        btn.titleLabel.font = MY_SCALE_SemiboldFONT(16);
        [btn setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
    }
    
    NSMutableDictionary *dic = [MYGlobal share].shuiyinDic[self.type];
    timeType = dic[@"timeType"];
    LocationModel *locationModel = [GetLocation sharedManager].model;
    if([self.type isEqualToString:DAKATYPE] || [self.type isEqualToString:KAOQINATYPE]|| [self.type isEqualToString:WUYETYPE]){
        if(dic[@"1time"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"时间：");
            tempDic[@"value"] = [[MYGlobal share]getdayAndWeek:dic[@"timeType"]];
            tempDic[@"state"] = dic[@"1time"];
            tempDic[@"change"] = @"1";
//            if( [self.type isEqualToString:KAOQINATYPE]){
//                tempDic[@"change"] = @"0";
//            }
            [_dataArray addObject:tempDic];
        }
        
        if(dic[@"2address"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"地点：");
            if([self.type isEqualToString:DAKATYPE]){
                tempDic[@"value"] = locationModel.sjdkdd;
            }else if([self.type isEqualToString:KAOQINATYPE] ){
                tempDic[@"value"] = locationModel.kqdkdd;
            }else if([self.type isEqualToString:WUYETYPE] ){
                tempDic[@"value"] = locationModel.wydd;
            }
            tempDic[@"state"] = dic[@"2address"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        
        if(dic[@"3tianqi"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"天气：");
            tempDic[@"value"] = locationModel.tianqi;
            tempDic[@"state"] = dic[@"3tianqi"];
            tempDic[@"change"] = @"0";
            [_dataArray addObject:tempDic];
        }
        
        if(dic[@"4jingwei"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"经纬度：");
            tempDic[@"value"] = locationModel.jw;
            tempDic[@"state"] = dic[@"4jingwei"];
            tempDic[@"change"] = @"0";
            [_dataArray addObject:tempDic];
        }
        
        if(dic[@"5beizhu"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"备注：");
            tempDic[@"state"] = dic[@"5beizhu"];
            if([self.type isEqualToString:DAKATYPE]){
                tempDic[@"value"] = locationModel.sjdkbz;
            }else if([self.type isEqualToString:KAOQINATYPE]){
                tempDic[@"value"] = locationModel.kqdlbz;
            }else if([self.type isEqualToString:WUYETYPE]){
                tempDic[@"value"] = locationModel.wybz;
            }
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        
    }else if([self.type isEqualToString:GONGCHENGTYPE]){

//        if(dic[@"1time"]){
//            NSMutableDictionary *tempDic = [NSMutableDictionary new];
//            tempDic[@"key"] = LocalizedString(@"时间：");
//            tempDic[@"value"] = [[MYGlobal share]getdayAndWeek:dic[@"timeType"]];
//            tempDic[@"state"] = dic[@"1time"];
//            tempDic[@"change"] = @"0";
//            [_dataArray addObject:tempDic];
//        }
                //kaoqinDic[@"2name"] = @"1";
        if(dic[@"2name"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"项目名称：");
            tempDic[@"value"] = locationModel.gcmz;
            tempDic[@"state"] = dic[@"2name"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        kaoqinDic[@"3quyu"] = @"1";
        if(dic[@"3quyu"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"施工区域：");
            tempDic[@"value"] = locationModel.quyu;
            tempDic[@"state"] = dic[@"3quyu"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        kaoqinDic[@"4sgnr"] = @"0";
        if(dic[@"4sgnr"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"施工内容：");
            tempDic[@"value"] = locationModel.sgnr;;
            tempDic[@"state"] = dic[@"4sgnr"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        kaoqinDic[@"5sgfzr"] = @"0";
        if(dic[@"5sgfzr"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"施工负责人：");
            tempDic[@"value"] = locationModel.sgfzr;;
            tempDic[@"state"] = dic[@"5sgfzr"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        kaoqinDic[@"6jlfzr"] = @"0";
        if(dic[@"6jlfzr"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"监理负责人：");
            tempDic[@"value"] = locationModel.jlfzr;;
            tempDic[@"state"] = dic[@"6jlfzr"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        kaoqinDic[@"7jsdw"] = @"0";
        if(dic[@"7jsdw"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"建设单位：");
            tempDic[@"value"] = locationModel.jsdw;;
            tempDic[@"state"] = dic[@"7jsdw"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        kaoqinDic[@"8jldw"] = @"0";
        if(dic[@"8jldw"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"监理单位：");
            tempDic[@"value"] = locationModel.jldw;;
            tempDic[@"state"] = dic[@"8jldw"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        kaoqinDic[@"9sgdw"] = @"0";
        if(dic[@"9sgdw"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"施工单位：");
            tempDic[@"value"] = locationModel.sgdw;;
            tempDic[@"state"] = dic[@"9sgdw"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        kaoqinDic[@"10sjdw"] = @"0";
        if(dic[@"10sjdw"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"设计单位：");
            tempDic[@"value"] = locationModel.sjdw;;
            tempDic[@"state"] = dic[@"10sjdw"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        kaoqinDic[@"11ktdw"] = @"0";
        if(dic[@"11ktdw"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"勘探单位：");
            tempDic[@"value"] = locationModel.ktdw;
            tempDic[@"state"] = dic[@"11ktdw"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        kaoqinDic[@"12tianqi"] = @"1";
        if(dic[@"12tianqi"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"天气：");
            tempDic[@"value"] = locationModel.tianqi;
            tempDic[@"state"] = dic[@"12tianqi"];
            tempDic[@"change"] = @"0";
            [_dataArray addObject:tempDic];
        }
        //        kaoqinDic[@"13jwd"] = @"1";
        if(dic[@"13jwd"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"经纬度：");
            tempDic[@"value"] = locationModel.jw;
            tempDic[@"state"] = dic[@"12tianqi"];
            tempDic[@"change"] = @"0";
            [_dataArray addObject:tempDic];
        }
        //        kaoqinDic[@"14beizhu"] = @"0";
        if(dic[@"14beizhu"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"备注：");
            tempDic[@"value"] = locationModel.gcbz;
            tempDic[@"state"] = dic[@"14beizhu"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
    }else if([self.type isEqualToString:ZHIQINTYPE]){
        //        zhiqinDic[@"1zxry"] = self.dataArray[0][@"state"];
        if(dic[@"1zxry"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"执勤人员：");
            tempDic[@"value"] = LocalizedString(@"请输入");
            tempDic[@"state"] = dic[@"1zxry"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        zhiqinDic[@"2time"] = self.dataArray[1][@"state"];
        if(dic[@"2time"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"时间：");
            tempDic[@"value"] = [[MYGlobal share]getdayAndWeek:dic[@"timeType"]];
            tempDic[@"state"] = dic[@"2time"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        zhiqinDic[@"3address"] = self.dataArray[2][@"state"];
        if(dic[@"3address"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"地点：");
            tempDic[@"value"] = locationModel.xldd;
            tempDic[@"state"] = dic[@"3address"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        zhiqinDic[@"4xlqy"] = self.dataArray[3][@"state"];
        if(dic[@"4xlqy"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"巡逻区域：");
            tempDic[@"value"] = locationModel.xlqy;
            tempDic[@"state"] = dic[@"4xlqy"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        zhiqinDic[@"5xljg"] = self.dataArray[4][@"state"];
        if(dic[@"5xljg"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"巡逻结果：");
            tempDic[@"value"] = locationModel.xljg;
            tempDic[@"state"] = dic[@"5xljg"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        zhiqinDic[@"6tfsj"] = self.dataArray[5][@"state"];
        if(dic[@"6tfsj"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"突发事件：");
            tempDic[@"value"] = locationModel.tfsj;
            tempDic[@"state"] = dic[@"6tfsj"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        zhiqinDic[@"7tianqi"] = self.dataArray[6][@"state"];
        if(dic[@"7tianqi"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"天气：");
            tempDic[@"value"] = locationModel.tianqi;
            tempDic[@"state"] = dic[@"7tianqi"];
            tempDic[@"change"] = @"0";
            [_dataArray addObject:tempDic];
        }
        //        zhiqinDic[@"8jingwei"] = self.dataArray[7][@"state"];
        if(dic[@"8jingwei"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"经纬度：");
            tempDic[@"value"] = locationModel.jw;
            tempDic[@"state"] = dic[@"8jingwei"];
            tempDic[@"change"] = @"0";
            [_dataArray addObject:tempDic];
        }
        //        zhiqinDic[@"9beizhu"] = self.dataArray[8][@"state"];
        if(dic[@"9beizhu"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"备注：");
            tempDic[@"value"] = locationModel.xlbz;
            tempDic[@"state"] = dic[@"9beizhu"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
    }else if([self.type isEqualToString:KUAIDITYPE]){
        //        kauaidDic[@"1psr"] = @"1";
        if(dic[@"1psr"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"配送人：");
            tempDic[@"value"] = locationModel.psr;
            tempDic[@"state"] = dic[@"1psr"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        kauaidDic[@"2psnr"] = @"1";
        if(dic[@"2psnr"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"配送内容：");
            tempDic[@"value"] = locationModel.psnr;
            tempDic[@"state"] = dic[@"2psnr"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        kauaidDic[@"3psdd"] = @"1";
        if(dic[@"3psdd"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"配送地点：");
            tempDic[@"value"] = locationModel.kddd;
            tempDic[@"state"] = dic[@"3psdd"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        kauaidDic[@"4sjr"] = @"0";
        if(dic[@"4sjr"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"收件人：");
            tempDic[@"value"] = locationModel.sjr;
            tempDic[@"state"] = dic[@"4sjr"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        kauaidDic[@"5sjrdh"] = @"0";
        if(dic[@"5sjrdh"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"收件人电话：");
            tempDic[@"value"] = locationModel.sjrdh;
            tempDic[@"state"] = dic[@"5sjrdh"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        kauaidDic[@"6jjr"] = @"0";
        if(dic[@"6jjr"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"寄件人：");
            tempDic[@"value"] = locationModel.jjr;
            tempDic[@"state"] = dic[@"6jjr"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        kauaidDic[@"7jjrdh"] = @"0";
        if(dic[@"7jjrdh"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"寄件人电话：");
            tempDic[@"value"] = locationModel.jjrdh;
            tempDic[@"state"] = dic[@"7jjrdh"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        kauaidDic[@"8kdgs"] = @"0";
        if(dic[@"8kdgs"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"快递公司：");
            tempDic[@"value"] = locationModel.kdgs;
            tempDic[@"state"] = dic[@"8kdgs"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        kauaidDic[@"9time"] = @"1";
        if(dic[@"9time"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"时间：");
            tempDic[@"value"] = [[MYGlobal share]getdayAndWeek:dic[@"timeType"]];
            tempDic[@"state"] = dic[@"9time"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        kauaidDic[@"10tianqi"] = @"1";
        if(dic[@"10tianqi"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"天气：");
            tempDic[@"value"] = locationModel.tianqi;
            tempDic[@"state"] = dic[@"10tianqi"];
            tempDic[@"change"] = @"0";
            [_dataArray addObject:tempDic];
        }
        //        kauaidDic[@"11jingwei"] = @"0";
        if(dic[@"11jingwei"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"经纬度：");
            tempDic[@"value"] = locationModel.jw;
            tempDic[@"state"] = dic[@"11jingwei"];
            tempDic[@"change"] = @"0";
            [_dataArray addObject:tempDic];
        }
        //        kauaidDic[@"12beizhu"] = @"0";
        if(dic[@"12beizhu"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"备注：");
            tempDic[@"value"] = locationModel.kdbz;
            tempDic[@"state"] = dic[@"12beizhu"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
    }else if([self.type isEqualToString:RICHANGTYPE]){
        //        richangDic[@"1time"] = @"1";
        if(dic[@"1time"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"时间：");
            tempDic[@"value"] = [[MYGlobal share]getdayAndWeek:dic[@"timeType"]];
            tempDic[@"state"] = dic[@"1time"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        richangDic[@"2xjdd"] = @"1";
        if(dic[@"2xjdd"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"巡查地点：");
            tempDic[@"value"] = locationModel.rcdd;
            tempDic[@"state"] = dic[@"2xjdd"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        richangDic[@"3xjry"] = @"1";
        if(dic[@"3xjry"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"巡检人员：");
            tempDic[@"value"] = locationModel.xjry;
            tempDic[@"state"] = dic[@"3xjry"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        richangDic[@"4xjnr"] = @"0";
        if(dic[@"4xjnr"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"巡检内容：");
            tempDic[@"value"] = locationModel.xjnr;
            tempDic[@"state"] = dic[@"4xjnr"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        richangDic[@"5tianqi"] = @"1";
        if(dic[@"5tianqi"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"天气：");
            tempDic[@"value"] = locationModel.tianqi;
            tempDic[@"state"] = dic[@"5tianqi"];
            tempDic[@"change"] = @"0";
            [_dataArray addObject:tempDic];
        }
        //        richangDic[@"6jingwei"] = @"2";
        if(dic[@"6jingwei"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"经纬度：");
            tempDic[@"value"] = locationModel.jw;
            tempDic[@"state"] = dic[@"6jingwei"];
            tempDic[@"change"] = @"0";
            [_dataArray addObject:tempDic];
        }
        //        richangDic[@"7beizhu"] = @"0";
        if(dic[@"7beizhu"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"备注：");
            tempDic[@"value"] = locationModel.rcbz;
            tempDic[@"state"] = dic[@"7beizhu"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
    }else if([self.type isEqualToString:JIAZHENGTYPE]){
        //        jiazhengDic[@"1time"] = @"1";
        //        jiazhengDic[@"2fwdd"] = @"1";
        //        jiazhengDic[@"3jzry"] = @"1";
        //        jiazhengDic[@"4gznr"] = @"1";
        //        jiazhengDic[@"5tianqi"] = @"1";
        //        jiazhengDic[@"6jingwei"] = @"0";
        //        jiazhengDic[@"7beizhu"] = @"0";
        if(dic[@"1time"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"时间：");
            tempDic[@"value"] = [[MYGlobal share]getdayAndWeek:dic[@"timeType"]];
            tempDic[@"state"] = dic[@"1time"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        if(dic[@"2fwdd"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"服务地点：");
            tempDic[@"value"] = locationModel.jzdd;
            tempDic[@"state"] = dic[@"2fwdd"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        if(dic[@"3jzry"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"家政人员：");
            tempDic[@"value"] = locationModel.jzry;
            tempDic[@"state"] = dic[@"3jzry"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        if(dic[@"4gznr"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"工作内容：");
            tempDic[@"value"] = locationModel.gznr;
            tempDic[@"state"] = dic[@"4gznr"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        
        if(dic[@"5tianqi"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"天气：");
            tempDic[@"value"] = locationModel.tianqi;
            tempDic[@"state"] = dic[@"5tianqi"];
            tempDic[@"change"] = @"0";
            [_dataArray addObject:tempDic];
        }
        
        if(dic[@"6jingwei"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"经纬度：");
            tempDic[@"value"] = locationModel.jw;
            tempDic[@"state"] = dic[@"6jingwei"];
            tempDic[@"change"] = @"0";
            [_dataArray addObject:tempDic];
        }
        
        if(dic[@"7beizhu"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"备注：");
            tempDic[@"value"] = locationModel.jzbz;
            tempDic[@"state"] = dic[@"7beizhu"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
    }else if([self.type isEqualToString:HUIYITYPE]){
        //        hyjyDic[@"1time"] = @"1";
        if(dic[@"1time"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"时间：");
            tempDic[@"value"] = [[MYGlobal share]getdayAndWeek:dic[@"timeType"]];
            tempDic[@"state"] = dic[@"1time"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        hyjyDic[@"2hyjy"] = @"1";
        if(dic[@"2hymc"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"会议名称：");
            tempDic[@"value"] = locationModel.hymc;
            tempDic[@"state"] = dic[@"2hymc"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        hyjyDic[@"3hyrs"] = @"1";
        if(dic[@"3hyrs"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"会议人数：");
            tempDic[@"value"] = locationModel.hyrs;
            tempDic[@"state"] = dic[@"3hyrs"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        hyjyDic[@"4hynr"] = @"1";
        if(dic[@"4hynr"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"会议内容：");
            tempDic[@"value"] = locationModel.hynr;
            tempDic[@"state"] = dic[@"4hynr"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        hyjyDic[@"5hydd"] = @"1";
        if(dic[@"5hydd"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"会议地点：");
            tempDic[@"value"] = locationModel.hydd;
            tempDic[@"state"] = dic[@"5hydd"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        hyjyDic[@"6zcr"] = @"0";
        if(dic[@"6zcr"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"主持人：");
            tempDic[@"value"] = locationModel.zcr;
            tempDic[@"state"] = dic[@"6zcr"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        hyjyDic[@"7yhry"] = @"0";
        if(dic[@"7yhry"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"与会人员：");
            tempDic[@"value"] = locationModel.yhry;
            tempDic[@"state"] = dic[@"7yhry"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        hyjyDic[@"8tianqi"] = @"1";
        if(dic[@"8tianqi"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"天气：");
            tempDic[@"value"] = locationModel.tianqi;
            tempDic[@"state"] = dic[@"8tianqi"];
            tempDic[@"change"] = @"0";
            [_dataArray addObject:tempDic];
        }
        //        hyjyDic[@"9jingwei"] = @"0";
        if(dic[@"9jingwei"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"经纬度：");
            tempDic[@"value"] = locationModel.jw;
            tempDic[@"state"] = dic[@"9jingwei"];
            tempDic[@"change"] = @"0";
            [_dataArray addObject:tempDic];
        }
        //        hyjyDic[@"10beizhu"] = @"0";
        if(dic[@"10beizhu"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"备注：");
            tempDic[@"value"] = locationModel.hyjybz;
            tempDic[@"state"] = dic[@"10beizhu"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
    }else if([self.type isEqualToString:FANGWUTYPE]){
        //        fwysDic[@"1dkr"] = @"1";
        if(dic[@"1dkr"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"带看人：");
            tempDic[@"value"] = locationModel.dkr;
            tempDic[@"state"] = dic[@"1dkr"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        fwysDic[@"2khmc"] = @"1";
        if(dic[@"2khmc"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"客户名称：");
            tempDic[@"value"] = locationModel.khmc;
            tempDic[@"state"] = dic[@"2khmc"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        fwysDic[@"3time"] = @"1";
        if(dic[@"3time"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"时间：");
            tempDic[@"value"] = [[MYGlobal share]getdayAndWeek:dic[@"timeType"]];
            tempDic[@"state"] = dic[@"3time"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        fwysDic[@"4dd"] = @"1";
        if(dic[@"4dd"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"地点：");
            tempDic[@"value"] = locationModel.fwdd;
            tempDic[@"state"] = dic[@"4dd"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        fwysDic[@"5tianqi"] = @"1";
        if(dic[@"5tianqi"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"天气：");
            tempDic[@"value"] = locationModel.tianqi;
            tempDic[@"state"] = dic[@"5tianqi"];
            tempDic[@"change"] = @"0";
            [_dataArray addObject:tempDic];
        }
        //        fwysDic[@"6jwd"] = @"0";
        if(dic[@"6jwd"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"经纬度：");
            tempDic[@"value"] = locationModel.tianqi;
            tempDic[@"state"] = dic[@"6jwd"];
            tempDic[@"change"] = @"0";
            [_dataArray addObject:tempDic];
        }
        //        fwysDic[@"7beizhu"] = @"0";
        if(dic[@"7beizhu"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"备注：");
            tempDic[@"value"] = locationModel.fwyzbz;
            tempDic[@"state"] = dic[@"7beizhu"];
            tempDic[@"change"] = @"0";
            [_dataArray addObject:tempDic];
        }
    }else if([self.type isEqualToString:RENWUTYPE]){
        //        rwgdDic[@"1jdr"] = @"1";
        //        rwgdDic[@"2gcxm"] = @"1";
        //        rwgdDic[@"3khmc"] = @"1";
        //        rwgdDic[@"4lxfs"] = @"1";
        //        rwgdDic[@"5dd"] = @"1";
        //        rwgdDic[@"6time"] = @"1";
        //        rwgdDic[@"7tianqi"] = @"1";
        //        rwgdDic[@"8jwd"] = @"0";
        //        rwgdDic[@"9beizhu"] = @"0";
        if(dic[@"1jdr"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"接单人：");
            tempDic[@"value"] = locationModel.jdr;
            tempDic[@"state"] = dic[@"1jdr"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        if(dic[@"2gcxm"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"工程项目：");
            tempDic[@"value"] = locationModel.gcxm;
            tempDic[@"state"] = dic[@"2gcxm"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        if(dic[@"3khmc"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"客户名称：");
            tempDic[@"value"] = locationModel.khmc;
            tempDic[@"state"] = dic[@"3khmc"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        if(dic[@"4lxfs"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"联系方式：");
            tempDic[@"value"] = locationModel.lxfs;
            tempDic[@"state"] = dic[@"4lxfs"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        if(dic[@"5dd"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"地点：");
            tempDic[@"value"] = locationModel.rwdd;
            tempDic[@"state"] = dic[@"5dd"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        if(dic[@"6time"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"时间：");
            tempDic[@"value"] = [[MYGlobal share]getdayAndWeek:dic[@"timeType"]];
            tempDic[@"state"] = dic[@"6time"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        if(dic[@"7tianqi"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"天气：");
            tempDic[@"value"] = locationModel.tianqi;
            tempDic[@"state"] = dic[@"7tianqi"];
            tempDic[@"change"] = @"0";
            [_dataArray addObject:tempDic];
        }
        if(dic[@"8jwd"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"经纬度：");
            tempDic[@"value"] = locationModel.jw;
            tempDic[@"state"] = dic[@"8jwd"];
            tempDic[@"change"] = @"0";
            [_dataArray addObject:tempDic];
        }
        if(dic[@"9beizhu"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"备注：");
            tempDic[@"value"] = locationModel.rwbz;
            tempDic[@"state"] = dic[@"9beizhu"];
            tempDic[@"change"] = @"0";
            [_dataArray addObject:tempDic];
        }
    }else if([self.type isEqualToString:WAIPAITYPE]){
        //        wpxxDic[@"1wpry"] = @"0";
        if(dic[@"1wpry"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"外派人员：");
            tempDic[@"value"] = locationModel.wpry;
            tempDic[@"state"] = dic[@"1wpry"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        wpxxDic[@"2wpdd"] = @"0";
        if(dic[@"2wpdd"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"外派地点：");
            tempDic[@"value"] = locationModel.wpdd;
            tempDic[@"state"] = dic[@"2wpdd"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        wpxxDic[@"3wpnr"] = @"0";
        if(dic[@"3wpnr"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"外派内容：");
            tempDic[@"value"] = locationModel.wpnr;
            tempDic[@"state"] = dic[@"3wpnr"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        wpxxDic[@"4time"] = @"1";
        if(dic[@"4time"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"时间：");
            tempDic[@"value"] = [[MYGlobal share]getdayAndWeek:dic[@"timeType"]];
            tempDic[@"state"] = dic[@"4time"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        wpxxDic[@"5dd"] = @"1";
        if(dic[@"5dd"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"地点：");
            tempDic[@"value"] = locationModel.wpdwdd;
            tempDic[@"state"] = dic[@"5dd"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        wpxxDic[@"6tianqi"] = @"1";
        if(dic[@"6tianqi"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"天气：");
            tempDic[@"value"] = locationModel.tianqi;
            tempDic[@"state"] = dic[@"6tianqi"];
            tempDic[@"change"] = @"0";
            [_dataArray addObject:tempDic];
        }
        //        wpxxDic[@"7jwd"] = @"1";
        if(dic[@"7jwd"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"经纬度：");
            tempDic[@"value"] = locationModel.jw;
            tempDic[@"state"] = dic[@"7jwd"];
            tempDic[@"change"] = @"0";
            [_dataArray addObject:tempDic];
        }
        //        wpxxDic[@"8beizhu"] = @"0";
        if(dic[@"8beizhu"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"备注：");
            tempDic[@"value"] = locationModel.wpbz;
            tempDic[@"state"] = dic[@"8beizhu"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
    }else if([self.type isEqualToString:GUANAITYPE]){
        //        wpxxDic[@"1gzxm"] = @"1";
        if(dic[@"1gzxm"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"雇主姓名：");
            tempDic[@"value"] = locationModel.gzxm;
            tempDic[@"state"] = dic[@"1gzxm"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        wpxxDic[@"2hgxm"] = @"1";
        if(dic[@"2hgxm"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"护工姓名：");
            tempDic[@"value"] = locationModel.hgxm;
            tempDic[@"state"] = dic[@"2hgxm"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        wpxxDic[@"3lxfs"] = @"0";
        if(dic[@"3lxfs"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"联系方式：");
            tempDic[@"value"] = locationModel.galxfs;
            tempDic[@"state"] = dic[@"3lxfs"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        wpxxDic[@"4time"] = @"1";
        if(dic[@"4time"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"时间：");
            tempDic[@"value"] = [[MYGlobal share]getdayAndWeek:dic[@"timeType"]];
            tempDic[@"state"] = dic[@"4time"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        wpxxDic[@"5dd"] = @"1";
        if(dic[@"5dd"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"地址：");
            tempDic[@"value"] = locationModel.gadd;
            tempDic[@"state"] = dic[@"5dd"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        wpxxDic[@"6tianqi"] = @"1";
        if(dic[@"6tianqi"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"天气：");
            tempDic[@"value"] = locationModel.tianqi;
            tempDic[@"state"] = dic[@"6tianqi"];
            tempDic[@"change"] = @"0";
            [_dataArray addObject:tempDic];
        }
        //        wpxxDic[@"7jwd"] = @"1";
        if(dic[@"7jwd"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"经纬度：");
            tempDic[@"value"] = locationModel.jw;
            tempDic[@"state"] = dic[@"7jwd"];
            tempDic[@"change"] = @"0";
            [_dataArray addObject:tempDic];
        }
        //        wpxxDic[@"8beizhu"] = @"0";
        if(dic[@"8beizhu"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"备注：");
            tempDic[@"value"] = locationModel.gabz;
            tempDic[@"state"] = dic[@"8beizhu"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
    }else if([self.type isEqualToString:LVYOUTYPE]){
        //        lydkDic[@"1tianqi"] = @"1";
        if(dic[@"1tianqi"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"天气：");
            tempDic[@"value"] = locationModel.tianqi;
            tempDic[@"state"] = dic[@"1tianqi"];
            tempDic[@"change"] = @"0";
            [_dataArray addObject:tempDic];
        }
        //        lydkDic[@"2jdmc"] = @"1";
        if(dic[@"2jdmc"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"景点名称：");
            tempDic[@"value"] = locationModel.jdmc;
            tempDic[@"state"] = dic[@"2jdmc"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        lydkDic[@"3ylry"] = @"0";
        if(dic[@"3ylry"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"游览人员：");
            tempDic[@"value"] = locationModel.lyry;
            tempDic[@"state"] = dic[@"3ylry"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        lydkDic[@"4ylrs"] = @"0";
        if(dic[@"4ylrs"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"游览人数：");
            tempDic[@"value"] = locationModel.lyrs;
            tempDic[@"state"] = dic[@"4ylrs"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        lydkDic[@"5time"] = @"1";
        if(dic[@"5time"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"时间：");
            tempDic[@"value"] = [[MYGlobal share]getdayAndWeek:dic[@"timeType"]];
            tempDic[@"state"] = dic[@"5time"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        lydkDic[@"6add"] = @"1";
        if(dic[@"6add"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"地点：");
            tempDic[@"value"] = locationModel.lydd;
            tempDic[@"state"] = dic[@"6add"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
        //        lydkDic[@"7jwd"] = @"1";
        if(dic[@"7jwd"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"经纬度：");
            tempDic[@"value"] = locationModel.jw;
            tempDic[@"state"] = dic[@"7jwd"];
            tempDic[@"change"] = @"0";
            [_dataArray addObject:tempDic];
        }
        //        lydkDic[@"8beizhu"] = @"0";
        if(dic[@"8beizhu"]){
            NSMutableDictionary *tempDic = [NSMutableDictionary new];
            tempDic[@"key"] = LocalizedString(@"备注：");
            tempDic[@"value"] = locationModel.lybz;
            tempDic[@"state"] = dic[@"8beizhu"];
            tempDic[@"change"] = @"1";
            [_dataArray addObject:tempDic];
        }
    }
    [_showTableView reloadData];
    [UIView animateWithDuration:0.3 animations:^{
        self.backgroundColor = MyColorAlpha(@"000000", 0.0);
        self.top = 0;
    }];
}

#pragma mark - tableViewDelegate
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return self.dataArray.count;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    NSDictionary *modeDic = self.dataArray[indexPath.row];
    static NSString *identifier = @"WatermarkEditCell";
    WatermarkEditCell *cell=[tableView dequeueReusableCellWithIdentifier:identifier];
    if (cell==nil) {
        cell=[[WatermarkEditCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier];
        cell.selectionStyle=UITableViewCellSelectionStyleNone;
    }
    [cell update:modeDic];
    
    __strong typeof(self) weakSelf = self;
    cell.watermarkEditBlock = ^(NSInteger index) {
        __strong typeof(weakSelf) strongSelf = weakSelf;
        if(index == 0){
            //关闭
            strongSelf.dataArray[indexPath.row][@"state"] = [NSString stringWithFormat:@"%d",0];
            [strongSelf.showTableView reloadData];
        }else if(index == 1){
            //开启
            strongSelf.dataArray[indexPath.row][@"state"] = [NSString stringWithFormat:@"%d",1];
            [strongSelf.showTableView reloadData];
        }
        [self changeState];
    };
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    NSDictionary *modeDic = self.dataArray[indexPath.row];
    if([self.type isEqualToString:DAKATYPE] ||[self.type isEqualToString:KAOQINATYPE]||[self.type isEqualToString:WUYETYPE]){
        if(indexPath.row == 0){
            SelectTimeTypeView *timeTypeView = [SelectTimeTypeView new];
            timeTypeView.selecttimeTypeBlock = ^(NSString *type) {
                self->timeType = type;
                self.dataArray[indexPath.row][@"value"] = [[MYGlobal share] getdayAndWeek:type];
                DLog(@"dataArray==%@",self.dataArray);
                [self.showTableView reloadData];
            };
        }else if(indexPath.row == 1){
            SelectAddressView *tempView = [SelectAddressView new];
            tempView.selectpoiBlock = ^(AMapPOI * _Nonnull poi) {
                NSString *address = [NSString stringWithFormat:@"%@·%@·%@",poi.province,poi.city,poi.name];
                if([poi.province isEqualToString:poi.city]){
                    address = [NSString stringWithFormat:@"%@·%@",poi.city,poi.name];
                }
                self.dataArray[indexPath.row][@"value"] = address;
                [self.showTableView reloadData];
            };
        }else if(indexPath.row == 4){
            BeizhuView *view = [[BeizhuView alloc]initWithTitle:modeDic[@"key"] withContent:modeDic[@"value"]];
            view.beizhuBlock = ^(NSString * _Nonnull content,NSString *type) {
                if(content.qmui_trimAllWhiteSpace.length > 0){
                    self.dataArray[indexPath.row][@"value"] = content.qmui_trimAllWhiteSpace;
                    [self.showTableView reloadData];
                }
            };
        }
    }else if([self.type isEqualToString:GONGCHENGTYPE]){
//        if(indexPath.row == 0){
////            SelectTimeTypeView *timeTypeView = [SelectTimeTypeView new];
////            timeTypeView.selecttimeTypeBlock = ^(NSString *type) {
////                self->timeType = type;
////                self.dataArray[indexPath.row][@"value"] = [[MYGlobal share] getdayAndWeek:type];
////                dispatch_async(dispatch_get_main_queue(), ^{
////                    [self.showTableView reloadData];
////                });
////            };
//        }else {
            if([modeDic[@"change"] intValue] == 0){
                return;
            }
            BeizhuView *view = [[BeizhuView alloc]initWithTitle:modeDic[@"key"] withContent:modeDic[@"value"]];
            view.beizhuBlock = ^(NSString * _Nonnull content,NSString *type) {
                if(content.qmui_trimAllWhiteSpace.length > 0){
                    self.dataArray[indexPath.row][@"value"] = content.qmui_trimAllWhiteSpace;
                }
                [self.showTableView reloadData];
            };
//        }
    }else if([self.type isEqualToString:ZHIQINTYPE]){
        if(indexPath.row == 1){
            SelectTimeTypeView *timeTypeView = [SelectTimeTypeView new];
            timeTypeView.selecttimeTypeBlock = ^(NSString *type) {
                self->timeType = type;
                self.dataArray[indexPath.row][@"value"] = [[MYGlobal share] getdayAndWeek:type];
                DLog(@"dataArray==%@",self.dataArray);
                [self.showTableView reloadData];
            };
        }else if(indexPath.row == 2){
            SelectAddressView *tempView = [SelectAddressView new];
            tempView.selectpoiBlock = ^(AMapPOI * _Nonnull poi) {
                NSString *address = [NSString stringWithFormat:@"%@·%@·%@",poi.province,poi.city,poi.name];
                if([poi.province isEqualToString:poi.city]){
                    address = [NSString stringWithFormat:@"%@·%@",poi.city,poi.name];
                }
                self.dataArray[indexPath.row][@"value"] = address;
                [self.showTableView reloadData];
            };
        }else {
            if([modeDic[@"change"] intValue] == 0){
                return;
            }
            BeizhuView *view = [[BeizhuView alloc]initWithTitle:modeDic[@"key"] withContent:modeDic[@"value"]];
            view.beizhuBlock = ^(NSString * _Nonnull content,NSString *type) {
                if(content.qmui_trimAllWhiteSpace.length > 0){
                    self.dataArray[indexPath.row][@"value"] = content.qmui_trimAllWhiteSpace;
                }
                [self.showTableView reloadData];
            };
        }
    }else if([self.type isEqualToString:KUAIDITYPE]){
        if(indexPath.row == 8){
            SelectTimeTypeView *timeTypeView = [SelectTimeTypeView new];
            timeTypeView.selecttimeTypeBlock = ^(NSString *type) {
                self->timeType = type;
                self.dataArray[indexPath.row][@"value"] = [[MYGlobal share] getdayAndWeek:type];
                DLog(@"dataArray==%@",self.dataArray);
                [self.showTableView reloadData];
            };
        }else if(indexPath.row == 2){
            SelectAddressView *tempView = [SelectAddressView new];
            tempView.selectpoiBlock = ^(AMapPOI * _Nonnull poi) {
                NSString *address = [NSString stringWithFormat:@"%@·%@·%@",poi.province,poi.city,poi.name];
                if([poi.province isEqualToString:poi.city]){
                    address = [NSString stringWithFormat:@"%@·%@",poi.city,poi.name];
                }
                self.dataArray[indexPath.row][@"value"] = address;
                [self.showTableView reloadData];
            };
        }else {
            if([modeDic[@"change"] intValue] == 0){
                return;
            }
            BeizhuView *view = [[BeizhuView alloc]initWithTitle:modeDic[@"key"] withContent:modeDic[@"value"]];
            view.beizhuBlock = ^(NSString * _Nonnull content,NSString *type) {
                if(content.qmui_trimAllWhiteSpace.length > 0){
                    self.dataArray[indexPath.row][@"value"] = content.qmui_trimAllWhiteSpace;
                    DLog(@"self.dataArray==%@",self.dataArray);
                }
                [self.showTableView reloadData];
            };
        }
    }else if([self.type isEqualToString:RICHANGTYPE]){
        if(indexPath.row == 0){
            SelectTimeTypeView *timeTypeView = [SelectTimeTypeView new];
            timeTypeView.selecttimeTypeBlock = ^(NSString *type) {
                self->timeType = type;
                self.dataArray[indexPath.row][@"value"] = [[MYGlobal share] getdayAndWeek:type];
                DLog(@"dataArray==%@",self.dataArray);
                [self.showTableView reloadData];
            };
        }else if(indexPath.row == 1){
            SelectAddressView *tempView = [SelectAddressView new];
            tempView.selectpoiBlock = ^(AMapPOI * _Nonnull poi) {
                NSString *address = [NSString stringWithFormat:@"%@·%@·%@",poi.province,poi.city,poi.name];
                if([poi.province isEqualToString:poi.city]){
                    address = [NSString stringWithFormat:@"%@·%@",poi.city,poi.name];
                }
                self.dataArray[indexPath.row][@"value"] = address;
                [self.showTableView reloadData];
            };
        }else {
            if([modeDic[@"change"] intValue] == 0){
                return;
            }
            BeizhuView *view = [[BeizhuView alloc]initWithTitle:modeDic[@"key"] withContent:modeDic[@"value"]];
            view.beizhuBlock = ^(NSString * _Nonnull content,NSString *type) {
                if(content.qmui_trimAllWhiteSpace.length > 0){
                    self.dataArray[indexPath.row][@"value"] = content.qmui_trimAllWhiteSpace;
                }
                [self.showTableView reloadData];
            };
        }
    }else if([self.type isEqualToString:JIAZHENGTYPE]){
        if(indexPath.row == 0){
            SelectTimeTypeView *timeTypeView = [SelectTimeTypeView new];
            timeTypeView.selecttimeTypeBlock = ^(NSString *type) {
                self->timeType = type;
                self.dataArray[indexPath.row][@"value"] = [[MYGlobal share] getdayAndWeek:type];
                DLog(@"dataArray==%@",self.dataArray);
                [self.showTableView reloadData];
            };
        }else if(indexPath.row == 1){
            SelectAddressView *tempView = [SelectAddressView new];
            tempView.selectpoiBlock = ^(AMapPOI * _Nonnull poi) {
                NSString *address = [NSString stringWithFormat:@"%@·%@·%@",poi.province,poi.city,poi.name];
                if([poi.province isEqualToString:poi.city]){
                    address = [NSString stringWithFormat:@"%@·%@",poi.city,poi.name];
                }
                self.dataArray[indexPath.row][@"value"] = address;
                [self.showTableView reloadData];
            };
        }else {
            if([modeDic[@"change"] intValue] == 0){
                return;
            }
            BeizhuView *view = [[BeizhuView alloc]initWithTitle:modeDic[@"key"] withContent:modeDic[@"value"]];
            view.beizhuBlock = ^(NSString * _Nonnull content,NSString *type) {
                if(content.qmui_trimAllWhiteSpace.length > 0){
                    self.dataArray[indexPath.row][@"value"] = content.qmui_trimAllWhiteSpace;
                }
                [self.showTableView reloadData];
            };
        }
    }else if([self.type isEqualToString:HUIYITYPE]){
        if(indexPath.row == 0){
            SelectTimeTypeView *timeTypeView = [SelectTimeTypeView new];
            timeTypeView.selecttimeTypeBlock = ^(NSString *type) {
                self->timeType = type;
                self.dataArray[indexPath.row][@"value"] = [[MYGlobal share] getdayAndWeek:type];
                DLog(@"dataArray==%@",self.dataArray);
                [self.showTableView reloadData];
            };
        }else {
            if([modeDic[@"change"] intValue] == 0){
                return;
            }
            BeizhuView *view = [[BeizhuView alloc]initWithTitle:modeDic[@"key"] withContent:modeDic[@"value"]];
            view.beizhuBlock = ^(NSString * _Nonnull content,NSString *type) {
                if(content.qmui_trimAllWhiteSpace.length > 0){
                    self.dataArray[indexPath.row][@"value"] = content.qmui_trimAllWhiteSpace;
                }
                [self.showTableView reloadData];
            };
        }
    }else if([self.type isEqualToString:FANGWUTYPE]){
        if(indexPath.row == 2){
            SelectTimeTypeView *timeTypeView = [SelectTimeTypeView new];
            timeTypeView.selecttimeTypeBlock = ^(NSString *type) {
                self->timeType = type;
                self.dataArray[indexPath.row][@"value"] = [[MYGlobal share] getdayAndWeek:type];
                DLog(@"dataArray==%@",self.dataArray);
                [self.showTableView reloadData];
            };
        }else if(indexPath.row == 3){
            SelectAddressView *tempView = [SelectAddressView new];
            tempView.selectpoiBlock = ^(AMapPOI * _Nonnull poi) {
                NSString *address = [NSString stringWithFormat:@"%@·%@·%@",poi.province,poi.city,poi.name];
                if([poi.province isEqualToString:poi.city]){
                    address = [NSString stringWithFormat:@"%@·%@",poi.city,poi.name];
                }
                self.dataArray[indexPath.row][@"value"] = address;
                [self.showTableView reloadData];
            };
        }else {
            if([modeDic[@"change"] intValue] == 0){
                return;
            }
            BeizhuView *view = [[BeizhuView alloc]initWithTitle:modeDic[@"key"] withContent:modeDic[@"value"]];
            view.beizhuBlock = ^(NSString * _Nonnull content,NSString *type) {
                if(content.qmui_trimAllWhiteSpace.length > 0){
                    self.dataArray[indexPath.row][@"value"] = content.qmui_trimAllWhiteSpace;
                }
                [self.showTableView reloadData];
            };
        }
    }else if([self.type isEqualToString:RENWUTYPE]){
        if(indexPath.row == 5){
            SelectTimeTypeView *timeTypeView = [SelectTimeTypeView new];
            timeTypeView.selecttimeTypeBlock = ^(NSString *type) {
                self->timeType = type;
                self.dataArray[indexPath.row][@"value"] = [[MYGlobal share] getdayAndWeek:type];
                DLog(@"dataArray==%@",self.dataArray);
                [self.showTableView reloadData];
            };
        }else {
            if([modeDic[@"change"] intValue] == 0){
                return;
            }
            BeizhuView *view = [[BeizhuView alloc]initWithTitle:modeDic[@"key"] withContent:modeDic[@"value"]];
            view.beizhuBlock = ^(NSString * _Nonnull content,NSString *type) {
                if(content.qmui_trimAllWhiteSpace.length > 0){
                    self.dataArray[indexPath.row][@"value"] = content.qmui_trimAllWhiteSpace;
                }
                [self.showTableView reloadData];
            };
        }
    }else if([self.type isEqualToString:WAIPAITYPE]){
        if(indexPath.row == 3){
            SelectTimeTypeView *timeTypeView = [SelectTimeTypeView new];
            timeTypeView.selecttimeTypeBlock = ^(NSString *type) {
                self->timeType = type;
                self.dataArray[indexPath.row][@"value"] = [[MYGlobal share] getdayAndWeek:type];
                DLog(@"dataArray==%@",self.dataArray);
                [self.showTableView reloadData];
            };
        }else if(indexPath.row == 4){
            SelectAddressView *tempView = [SelectAddressView new];
            tempView.selectpoiBlock = ^(AMapPOI * _Nonnull poi) {
                NSString *address = [NSString stringWithFormat:@"%@·%@·%@",poi.province,poi.city,poi.name];
                if([poi.province isEqualToString:poi.city]){
                    address = [NSString stringWithFormat:@"%@·%@",poi.city,poi.name];
                }
                self.dataArray[indexPath.row][@"value"] = address;
                [self.showTableView reloadData];
            };
        }else {
            if([modeDic[@"change"] intValue] == 0){
                return;
            }
            BeizhuView *view = [[BeizhuView alloc]initWithTitle:modeDic[@"key"] withContent:modeDic[@"value"]];
            view.beizhuBlock = ^(NSString * _Nonnull content,NSString *type) {
                if(content.qmui_trimAllWhiteSpace.length > 0){
                    self.dataArray[indexPath.row][@"value"] = content.qmui_trimAllWhiteSpace;
                }
                [self.showTableView reloadData];
            };
        }
    }else if([self.type isEqualToString:GUANAITYPE]){
        if(indexPath.row == 3){
            SelectTimeTypeView *timeTypeView = [SelectTimeTypeView new];
            timeTypeView.selecttimeTypeBlock = ^(NSString *type) {
                self->timeType = type;
                self.dataArray[indexPath.row][@"value"] = [[MYGlobal share] getdayAndWeek:type];
                DLog(@"dataArray==%@",self.dataArray);
                [self.showTableView reloadData];
            };
        }else if(indexPath.row == 4){
            SelectAddressView *tempView = [SelectAddressView new];
            tempView.selectpoiBlock = ^(AMapPOI * _Nonnull poi) {
                NSString *address = [NSString stringWithFormat:@"%@·%@·%@",poi.province,poi.city,poi.name];
                if([poi.province isEqualToString:poi.city]){
                    address = [NSString stringWithFormat:@"%@·%@",poi.city,poi.name];
                }
                self.dataArray[indexPath.row][@"value"] = address;
                [self.showTableView reloadData];
            };
        }else {
            if([modeDic[@"change"] intValue] == 0){
                return;
            }
            BeizhuView *view = [[BeizhuView alloc]initWithTitle:modeDic[@"key"] withContent:modeDic[@"value"]];
            view.beizhuBlock = ^(NSString * _Nonnull content,NSString *type) {
                if(content.qmui_trimAllWhiteSpace.length > 0){
                    self.dataArray[indexPath.row][@"value"] = content.qmui_trimAllWhiteSpace;
                }
                [self.showTableView reloadData];
            };
        }
    }else if([self.type isEqualToString:LVYOUTYPE]){
        if(indexPath.row == 4){
            SelectTimeTypeView *timeTypeView = [SelectTimeTypeView new];
            timeTypeView.selecttimeTypeBlock = ^(NSString *type) {
                self->timeType = type;
                self.dataArray[indexPath.row][@"value"] = [[MYGlobal share] getdayAndWeek:type];
                DLog(@"dataArray==%@",self.dataArray);
                [self.showTableView reloadData];
            };
        }else if(indexPath.row == 5){
            SelectAddressView *tempView = [SelectAddressView new];
            tempView.selectpoiBlock = ^(AMapPOI * _Nonnull poi) {
                NSString *address = [NSString stringWithFormat:@"%@·%@·%@",poi.province,poi.city,poi.name];
                if([poi.province isEqualToString:poi.city]){
                    address = [NSString stringWithFormat:@"%@·%@",poi.city,poi.name];
                }
                self.dataArray[indexPath.row][@"value"] = address;
                [self.showTableView reloadData];
            };
        }else {
            if([modeDic[@"change"] intValue] == 0){
                return;
            }
            BeizhuView *view = [[BeizhuView alloc]initWithTitle:modeDic[@"key"] withContent:modeDic[@"value"]];
            view.beizhuBlock = ^(NSString * _Nonnull content,NSString *type) {
                if(content.qmui_trimAllWhiteSpace.length > 0){
                    self.dataArray[indexPath.row][@"value"] = content.qmui_trimAllWhiteSpace;
                }
                [self.showTableView reloadData];
            };
        }
    }
    
}

-(void)btnClick:(UIButton *)btn{
    if(btn.tag == 1000){
        //取消
    }else if(btn.tag == 1001){
        //确定
        [self changeState];
    }
    [UIView animateWithDuration:0.3 animations:^{
        self.backgroundColor = MyColorAlpha(@"000000", 0.4);
        self.top = MY_Screen_H;
    } completion:^(BOOL finished) {
        [self removeFromSuperview];
    }];
}
-(void)changeState{
    NSMutableDictionary *dic = [NSMutableDictionary new];
    LocationModel *model = [GetLocation sharedManager].model;
    dic[@"timeType"] = timeType;
    if([self.type isEqualToString:DAKATYPE] || [self.type isEqualToString:KAOQINATYPE]|| [self.type isEqualToString:WUYETYPE]){
        dic[@"1time"] = self.dataArray[0][@"state"];
        dic[@"2address"] = self.dataArray[1][@"state"];
        dic[@"3tianqi"] = self.dataArray[2][@"state"];
        dic[@"4jingwei"] = self.dataArray[3][@"state"];
        dic[@"5beizhu"] = self.dataArray[4][@"state"];
        if([self.type isEqualToString:DAKATYPE]){
            model.sjdkdd = self.dataArray[1][@"value"];
            model.sjdkbz = self.dataArray[4][@"value"];
        }else if([self.type isEqualToString:KAOQINATYPE]){
            model.kqdkdd = self.dataArray[1][@"value"];
            model.kqdlbz = self.dataArray[4][@"value"];
        }else if([self.type isEqualToString:WUYETYPE]){
            model.wydd = self.dataArray[1][@"value"];
            model.wybz = self.dataArray[4][@"value"];
        }
    }else if([self.type isEqualToString:GONGCHENGTYPE]){
        //dic[@"1time"] = self.dataArray[0][@"state"];
        dic[@"2name"] = self.dataArray[0][@"state"];
        dic[@"3quyu"] = self.dataArray[1][@"state"];
        dic[@"4sgnr"] = self.dataArray[2][@"state"];
        dic[@"5sgfzr"] = self.dataArray[3][@"state"];
        dic[@"6jlfzr"] = self.dataArray[4][@"state"];
        dic[@"7jsdw"] = self.dataArray[5][@"state"];
        dic[@"8jldw"] = self.dataArray[6][@"state"];
        dic[@"9sgdw"] = self.dataArray[7][@"state"];
        dic[@"10sjdw"] = self.dataArray[8][@"state"];
        dic[@"11ktdw"] = self.dataArray[9][@"state"];
        dic[@"12tianqi"] = self.dataArray[10][@"state"];
        dic[@"13jwd"] = self.dataArray[11][@"state"];
        dic[@"14beizhu"] = self.dataArray[12][@"state"];
        for (NSDictionary *tempDic in self.dataArray) {
            NSString *type = tempDic[@"key"];
            if([type containsString:LocalizedString(@"项目名称")]){
                model.gcmz = tempDic[@"value"];
            }else if([type containsString:LocalizedString(@"施工区域")]){
                model.quyu = tempDic[@"value"];
            }else if([type containsString:LocalizedString(@"施工内容")]){
                model.sgnr = tempDic[@"value"];
            }else if([type containsString:LocalizedString(@"施工负责人")]){
                model.sgfzr = tempDic[@"value"];
            }else if([type containsString:LocalizedString(@"监理负责人")]){
                model.jlfzr = tempDic[@"value"];
            }else if([type containsString:LocalizedString(@"建设单位")]){
                model.jsdw = tempDic[@"value"];
            }else if([type containsString:LocalizedString(@"监理单位")]){
                model.jldw = tempDic[@"value"];
            }else if([type containsString:LocalizedString(@"施工单位")]){
                model.sgdw = tempDic[@"value"];
            }else if([type containsString:LocalizedString(@"设计单位")]){
                model.sjdw = tempDic[@"value"];
            }else if([type containsString:LocalizedString(@"勘探单位")]){
                model.ktdw = tempDic[@"value"];
            }else if([type containsString:LocalizedString(@"备注")]){
                model.gcbz = tempDic[@"value"];
            }
        }
        
        
    }else if([self.type isEqualToString:ZHIQINTYPE]){
        model.xldd = self.dataArray[2][@"value"];
        dic[@"1zxry"] = self.dataArray[0][@"state"];
        dic[@"2time"] = self.dataArray[1][@"state"];
        dic[@"3address"] = self.dataArray[2][@"state"];
        dic[@"4xlqy"] = self.dataArray[3][@"state"];
        dic[@"5xljg"] = self.dataArray[4][@"state"];
        dic[@"6tfsj"] = self.dataArray[5][@"state"];
        dic[@"7tianqi"] = self.dataArray[6][@"state"];
        dic[@"8jingwei"] = self.dataArray[7][@"state"];
        dic[@"9beizhu"] = self.dataArray[8][@"state"];
        for (NSDictionary *tempDic in self.dataArray) {
            NSString *type = tempDic[@"key"];
            if([type containsString:LocalizedString(@"执勤人员")]){
                model.zqry = tempDic[@"value"];
            }else if([type containsString:LocalizedString(@"巡逻区域")]){
                model.xlqy = tempDic[@"value"];
            }else if([type containsString:LocalizedString(@"巡逻结果")]){
                model.xljg = tempDic[@"value"];
            }else if([type containsString:LocalizedString(@"突发事件")]){
                model.tfsj = tempDic[@"value"];
            }else if([type containsString:LocalizedString(@"备注")]){
                model.xlbz = tempDic[@"value"];
            }
        }
    }else if([self.type isEqualToString:KUAIDITYPE]){
        dic[@"1psr"] = self.dataArray[0][@"state"];
        dic[@"2psnr"] = self.dataArray[1][@"state"];
        dic[@"3psdd"] = self.dataArray[2][@"state"];
        model.kddd = self.dataArray[2][@"value"];
        dic[@"4sjr"] = self.dataArray[3][@"state"];
        dic[@"5sjrdh"] = self.dataArray[4][@"state"];
        dic[@"6jjr"] = self.dataArray[5][@"state"];
        dic[@"7jjrdh"] = self.dataArray[6][@"state"];
        dic[@"8kdgs"] = self.dataArray[7][@"state"];
        dic[@"9time"] = self.dataArray[8][@"state"];
        dic[@"10tianqi"] = self.dataArray[9][@"state"];
        dic[@"11jingwei"] = self.dataArray[10][@"state"];
        dic[@"12beizhu"] = self.dataArray[11][@"state"];
        for (NSDictionary *tempDic in self.dataArray) {
            NSString *type = tempDic[@"key"];
            DLog(@"type==%@  %@  %@",type,tempDic[@"value"],LocalizedString(@"收件人"));
            if([type containsString:LocalizedString(@"配送人")]){
                model.psr = tempDic[@"value"];
            }else if([type containsString:LocalizedString(@"配送内容")]){
                model.psnr = tempDic[@"value"];
            }else if([type isEqualToString:LocalizedString(@"收件人：")]){
                model.sjr = tempDic[@"value"];
            }else if([type containsString:LocalizedString(@"收件人电话")]){
                model.sjrdh = tempDic[@"value"];
            }else if([type isEqualToString:LocalizedString(@"寄件人：")]){
                model.jjr = tempDic[@"value"];
            }else if([type containsString:LocalizedString(@"寄件人电话")]){
                model.jjrdh = tempDic[@"value"];
            }else if([type containsString:LocalizedString(@"快递公司")]){
                model.kdgs = tempDic[@"value"];
            }else if([type containsString:LocalizedString(@"备注")]){
                model.kdbz = tempDic[@"value"];
            }
        }
    }else if([self.type isEqualToString:RICHANGTYPE]){
        dic[@"1time"] = self.dataArray[0][@"state"];
        dic[@"2xjdd"] = self.dataArray[1][@"state"];
        model.rcdd = self.dataArray[1][@"value"];
        dic[@"3xjry"] = self.dataArray[2][@"state"];
        dic[@"4xjnr"] = self.dataArray[3][@"state"];
        dic[@"5tianqi"] = self.dataArray[4][@"state"];
        dic[@"6jingwei"] = self.dataArray[5][@"state"];
        dic[@"7beizhu"] = self.dataArray[6][@"state"];
        for (NSDictionary *tempDic in self.dataArray) {
            NSString *type = tempDic[@"key"];
            if([type containsString:LocalizedString(@"巡检人员")]){
                model.xjry = tempDic[@"value"];
            }else if([type containsString:LocalizedString(@"巡检内容")]){
                model.xjnr = tempDic[@"value"];
            }else if([type containsString:LocalizedString(@"备注")]){
                model.rcbz = tempDic[@"value"];
            }
        }
    }else if([self.type isEqualToString:JIAZHENGTYPE]){
        dic[@"1time"] = self.dataArray[0][@"state"];
        dic[@"2fwdd"] = self.dataArray[1][@"state"];
        model.jzdd = self.dataArray[1][@"value"];
        dic[@"3jzry"] = self.dataArray[2][@"state"];
        dic[@"4gznr"] = self.dataArray[3][@"state"];
        dic[@"5tianqi"] = self.dataArray[4][@"state"];
        dic[@"6jingwei"] = self.dataArray[5][@"state"];
        dic[@"7beizhu"] = self.dataArray[6][@"state"];
        DLog(@"self.dataArray==%@",self.dataArray);
        for (NSDictionary *tempDic in self.dataArray) {
            NSString *type = tempDic[@"key"];
            if([type containsString:LocalizedString(@"家政人员")]){
                model.jzry = tempDic[@"value"];
            }else if([type containsString:LocalizedString(@"工作内容")]){
                model.gznr = tempDic[@"value"];
            }else if([type containsString:LocalizedString(@"备注")]){
                model.jzbz = tempDic[@"value"];
            }
        }
    }else if([self.type isEqualToString:HUIYITYPE]){
        DLog(@"self.dataArray==%@",self.dataArray);
        dic[@"1time"] = self.dataArray[0][@"state"];
        dic[@"2hymc"] = self.dataArray[1][@"state"];
        dic[@"3hyrs"] = self.dataArray[2][@"state"];
        dic[@"4hynr"] = self.dataArray[3][@"state"];
        dic[@"5hydd"] = self.dataArray[4][@"state"];
        dic[@"6zcr"] = self.dataArray[5][@"state"];
        dic[@"7yhry"] = self.dataArray[6][@"state"];
        dic[@"8tianqi"] = self.dataArray[7][@"state"];
        dic[@"9jingwei"] = self.dataArray[8][@"state"];
        dic[@"10beizhu"] = self.dataArray[9][@"state"];
        for (NSDictionary *tempDic in self.dataArray) {
            NSString *type = tempDic[@"key"];
            if([type containsString:LocalizedString(@"会议名称")]){
                model.hymc = tempDic[@"value"];
            }else if([type containsString:LocalizedString(@"会议人数")]){
                model.hyrs = tempDic[@"value"];
            }else if([type containsString:LocalizedString(@"会议内容")]){
                model.hynr = tempDic[@"value"];
            }else if([type containsString:LocalizedString(@"会议地点")]){
                model.hydd = tempDic[@"value"];
            }else if([type containsString:LocalizedString(@"主持人")]){
                model.zcr = tempDic[@"value"];
            }else if([type containsString:LocalizedString(@"与会人员")]){
                model.yhry = tempDic[@"value"];
            }else if([type containsString:LocalizedString(@"备注")]){
                model.hyjybz = tempDic[@"value"];
            }
        }
        
    }else if([self.type isEqualToString:FANGWUTYPE]){
        dic[@"1dkr"] = self.dataArray[0][@"state"];
        dic[@"2khmc"] = self.dataArray[1][@"state"];
        dic[@"3time"] = self.dataArray[2][@"state"];
        dic[@"4dd"] = self.dataArray[3][@"state"];
        model.fwdd = self.dataArray[3][@"value"];
        dic[@"5tianqi"] = self.dataArray[4][@"state"];
        dic[@"6jwd"] = self.dataArray[5][@"state"];
        dic[@"7beizhu"] = self.dataArray[6][@"state"];
        for (NSDictionary *tempDic in self.dataArray) {
            NSString *type = tempDic[@"key"];
            if([type containsString:LocalizedString(@"带看人")]){
                model.dkr = tempDic[@"value"];
            }else if([type containsString:LocalizedString(@"客户名称")]){
                model.khmc = tempDic[@"value"];
            }else if([type containsString:LocalizedString(@"备注")]){
                model.fwyzbz = tempDic[@"value"];
            }
        }
    }else if([self.type isEqualToString:RENWUTYPE]){
        dic[@"1jdr"] = self.dataArray[0][@"state"];
        dic[@"2gcxm"] = self.dataArray[1][@"state"];
        dic[@"3khmc"] = self.dataArray[2][@"state"];
        dic[@"4lxfs"] = self.dataArray[3][@"state"];
        dic[@"5dd"] = self.dataArray[4][@"state"];
        model.rwdd = self.dataArray[4][@"value"];
        dic[@"6time"] = self.dataArray[5][@"state"];
        dic[@"7tianqi"] = self.dataArray[6][@"state"];
        dic[@"8jwd"] = self.dataArray[7][@"state"];
        dic[@"9beizhu"] = self.dataArray[8][@"state"];
        for (NSDictionary *tempDic in self.dataArray) {
            NSString *type = tempDic[@"key"];
            if([type containsString:LocalizedString(@"接单人")]){
                model.jdr = tempDic[@"value"];
            }else if([type containsString:LocalizedString(@"工程项目")]){
                model.gcxm = tempDic[@"value"];
            }else if([type containsString:LocalizedString(@"客户名称")]){
                model.rwkhmc = tempDic[@"value"];
            }else if([type containsString:LocalizedString(@"联系方式")]){
                model.lxfs = tempDic[@"value"];
            }else if([type containsString:LocalizedString(@"地点")]){
                model.rwdd = tempDic[@"value"];
            }else if([type containsString:LocalizedString(@"备注")]){
                model.rwbz = tempDic[@"value"];
            }
        }
    }else if([self.type isEqualToString:WAIPAITYPE]){
        dic[@"1wpry"] = self.dataArray[0][@"state"];
        dic[@"2wpdd"] = self.dataArray[1][@"state"];
        dic[@"3wpnr"] = self.dataArray[2][@"state"];
        dic[@"4time"] = self.dataArray[3][@"state"];
        dic[@"5dd"] = self.dataArray[4][@"state"];
        model.wpdwdd = self.dataArray[4][@"value"];
        dic[@"6tianqi"] = self.dataArray[5][@"state"];
        dic[@"7jwd"] = self.dataArray[6][@"state"];
        dic[@"8beizhu"] = self.dataArray[7][@"state"];
        for (NSDictionary *tempDic in self.dataArray) {
            NSString *type = tempDic[@"key"];
            if([type containsString:LocalizedString(@"外派人员")]){
                model.wpry = tempDic[@"value"];
            }else if([type containsString:LocalizedString(@"外派地点")]){
                model.wpdd = tempDic[@"value"];
            }else if([type containsString:LocalizedString(@"外派内容")]){
                model.wpnr = tempDic[@"value"];
            }else if([type containsString:LocalizedString(@"备注")]){
                model.wpbz = tempDic[@"value"];
            }
        }
    }else if([self.type isEqualToString:GUANAITYPE]){
        dic[@"1gzxm"] = self.dataArray[0][@"state"];
        dic[@"2hgxm"] = self.dataArray[1][@"state"];
        dic[@"3lxfs"] = self.dataArray[2][@"state"];
        dic[@"4time"] = self.dataArray[3][@"state"];
        dic[@"5dd"] = self.dataArray[4][@"state"];
        model.gadd = self.dataArray[4][@"value"];
        dic[@"6tianqi"] = self.dataArray[5][@"state"];
        dic[@"7jwd"] = self.dataArray[6][@"state"];
        dic[@"8beizhu"] = self.dataArray[7][@"state"];
        for (NSDictionary *tempDic in self.dataArray) {
            NSString *type = tempDic[@"key"];
            if([type containsString:LocalizedString(@"雇主姓名")]){
                model.gzxm = tempDic[@"value"];
            }else if([type containsString:LocalizedString(@"护工姓名")]){
                model.hgxm = tempDic[@"value"];
            }else if([type containsString:LocalizedString(@"联系方式")]){
                model.galxfs = tempDic[@"value"];
            }else if([type containsString:LocalizedString(@"备注")]){
                model.gabz = tempDic[@"value"];
            }
        }
    }else if([self.type isEqualToString:LVYOUTYPE]){
        dic[@"1tianqi"] = self.dataArray[0][@"state"];
        dic[@"2jdmc"] = self.dataArray[1][@"state"];
        dic[@"3ylry"] = self.dataArray[2][@"state"];
        dic[@"4ylrs"] = self.dataArray[3][@"state"];
        dic[@"5time"] = self.dataArray[4][@"state"];
        dic[@"6add"] = self.dataArray[5][@"state"];
        model.lydd = self.dataArray[5][@"value"];
        dic[@"7jwd"] = self.dataArray[6][@"state"];
        dic[@"8beizhu"] = self.dataArray[7][@"state"];
        DLog(@"self.dataArray==%@",self.dataArray);
        for (NSDictionary *tempDic in self.dataArray) {
            NSString *type = tempDic[@"key"];
            if([type containsString:LocalizedString(@"景点名称")]){
                model.jdmc = tempDic[@"value"];
            }else if([type containsString:LocalizedString(@"游览人员")]){
                model.lyry = tempDic[@"value"];
            }else if([type containsString:LocalizedString(@"游览人数")]){
                model.lyrs = tempDic[@"value"];
            }else if([type containsString:LocalizedString(@"备注")]){
                model.lybz = tempDic[@"value"];
            }
        }
    }
    //是否提示没有字段可用
    BOOL flag = YES;
    for(NSString *key in dic.allKeys){
        NSString *value = dic[key];
        if([value isEqualToString:@"1"]){
            flag = NO;
        }
    }
    
    if(flag){
        [QMUITips showError:LocalizedString(@"请至少开启一项！")];
        return;
    }
    [MYGlobal share].shuiyinDic[self.type] = dic;
    [[MYGlobal share] saveData];
    if(self.doneEditBlock){
        self.doneEditBlock();
    }
}

- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
    // 圆角角度
    CGFloat radius = 10.f;
    // 设置cell 背景色为透明
    cell.backgroundColor = UIColor.whiteColor;
    // 创建两个layer
    CAShapeLayer *normalLayer = [[CAShapeLayer alloc] init];
    CAShapeLayer *selectLayer = [[CAShapeLayer alloc] init];
    // 获取显示区域大小
    CGRect bounds = CGRectInset(cell.bounds, [UIScreen mainScreen].bounds.size.width/375 * 14, 0);
    // cell的backgroundView
    UIView *normalBgView = [[UIView alloc] initWithFrame:bounds];
    // 获取每组行数
    NSInteger rowNum = [tableView numberOfRowsInSection:indexPath.section];
    // 贝塞尔曲线
    UIBezierPath *bezierPath = nil;
    
    if (rowNum == 1) {
        // 一组只有一行（四个角全部为圆角）
        bezierPath = [UIBezierPath bezierPathWithRoundedRect:bounds byRoundingCorners:UIRectCornerAllCorners cornerRadii:CGSizeMake(radius, radius)];
        normalBgView.clipsToBounds = NO;
    }else {
        normalBgView.clipsToBounds = YES;
        if (indexPath.row == 0) {
            normalBgView.frame = UIEdgeInsetsInsetRect(bounds, UIEdgeInsetsMake(0, 0, 0, 0));
            CGRect rect = UIEdgeInsetsInsetRect(bounds, UIEdgeInsetsMake(0, 0, 0, 0));
            // 每组第一行（添加左上和右上的圆角）
            bezierPath = [UIBezierPath bezierPathWithRoundedRect:rect byRoundingCorners:(UIRectCornerTopLeft|UIRectCornerTopRight) cornerRadii:CGSizeMake(radius, radius)];
        }else if (indexPath.row == rowNum - 1) {
            normalBgView.frame = UIEdgeInsetsInsetRect(bounds, UIEdgeInsetsMake(0, 0, 0, 0));
            CGRect rect = UIEdgeInsetsInsetRect(bounds, UIEdgeInsetsMake(0, 0, 0, 0));
            // 每组最后一行（添加左下和右下的圆角）
            bezierPath = [UIBezierPath bezierPathWithRoundedRect:rect byRoundingCorners:(UIRectCornerBottomLeft|UIRectCornerBottomRight) cornerRadii:CGSizeMake(radius, radius)];
        }else {
            // 每组不是首位的行不设置圆角
            bezierPath = [UIBezierPath bezierPathWithRect:bounds];
        }
    }
    
    // 阴影
    normalLayer.shadowColor = MyColor(@"#F1F1F1").CGColor;
    normalLayer.shadowOpacity = 0.2;
    normalLayer.shadowOffset = CGSizeMake(0, 0);
    normalLayer.path = bezierPath.CGPath;
    normalLayer.shadowPath = bezierPath.CGPath;
    
    // 把已经绘制好的贝塞尔曲线路径赋值给图层，然后图层根据path进行图像渲染render
    normalLayer.path = bezierPath.CGPath;
    selectLayer.path = bezierPath.CGPath;
    
    // 设置填充颜色
    normalLayer.fillColor = MyColor(@"#F1F1F1").CGColor;
    //    if (indexPath.row % 2 == 0) {
    //            normalLayer.fillColor = [UIColor whiteColor].CGColor;
    //        }else{
    //            normalLayer.fillColor = [UIColor colorWithHexString:@"e9e9e9"].CGColor;
    //        }
    // 添加图层到nomarBgView中
    [normalBgView.layer insertSublayer:normalLayer atIndex:0];
    normalBgView.backgroundColor = UIColor.clearColor;
    cell.backgroundView = normalBgView;
}

@end
